package pay.biz;

/**
 * @author 用户付款方式
 */
public enum PayTypeEnum {

    WX_MOBILE(0, "微信移动支付"),

    APAY_MOBILE(1, "支付宝移动支付"),

    ;

    /** 业务分类名称 */
    private int code;

    /** 业务分类描述 */
    private String description;

    /**
     * 构造函数
     * 
     * @param code
     * @param description
     */
    private PayTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static PayTypeEnum getEnumByCode(int code) {

        for (PayTypeEnum tmpEnum : PayTypeEnum.values()) {
            if (tmpEnum.getCode() == code) {
                return tmpEnum;
            }
        }

        return null;
    }

    /**
     * @return the code - {返回值描述信息}.
     */
    public int getCode() {
        return code;
    }

    /**
     * @param code
     *            to set - {参数含义描述}.
     */
    public void setCode(int code) {
        this.code = code;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description
     *            the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
